{% extends 'base.html' %}
{% load static %}

{% block 'title' %}用户{% endblock%}
{% block 'header-title' %}用户{% endblock%}
{% block 'content' %}

<div class="container">
    <hr>
    <section>
        <h1>用户信息</h1>
        <p>
            <div>
                <div class="table-responsive">
                    <table class="table  table-hover">
                        <tbody>
                            <tr>
                                <td>用户名</td>
                                <td>{{request.user.username}}</td>
                            </tr>

                            <tr>
                                <td>姓名</td>
                                <td>{{request.user.get_full_name}}</td>
                            </tr>
                            <tr>
                                <td>邮箱</td>
                                <td>{{request.user.email}}</td>
                            </tr>
                            <tr>
                                <td>用户组</td>
                                <td>{{request.user.groups}}</td>
                            </tr>
                            <tr>
                                <td>权限</td>
                                <td>{{request.user.user_permissions}}</td>
                            </tr>
                            <tr>
                                <td>上次登录</td>
                                <td>{{request.user.last_login}}</td>
                            </tr>
                            <tr>
                                <td>注册日期</td>
                                <td>{{request.user.date_joined}}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </p>
    </section>
    <hr>

    <section>
        <h1>收货地址</h1>
        <p>

            <a class="btn btn-link" href="{% url 'address' %}">点击管理</a>
        </p>
    </section>
    <hr>
    <section>
        <h1>修改密码</h1>
        {% include "message.html" %}
        <p>
            <div>
                <form method="post">
                    {% csrf_token %}
                    <div class="form-group">
                        <label for="password_raw">原密码</label>
                        <input type="password" class="form-control" name="password_raw" id="password_raw"
                            aria-describedby="emailHelp">
                        <small id="emailHelp" class="form-text text-muted">我们不会给你看密码</small>
                    </div>
                    <div class="form-group">
                        <label for="password_new">新密码</label>
                        <input type="password" class="form-control" name="password_new" id="password_new">
                    </div>
                    <div class="form-group">
                        <label for="password_repeat">确认密码</label>
                        <input type="password" class="form-control" name="password_repeat" id="password_repeat">
                    </div>
                    <button type="submit" class="btn btn-primary">修改</button>
                </form>
            </div>
        </p>
    </section>
    <hr>
</div>
{% endblock %}